package pe.edu.upc.dew.egretel.controller;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import pe.edu.upc.dew.egretel.model.Reclamo;
import pe.edu.upc.dew.egretel.service.BandejaEspecialistaService;
import pe.edu.upc.dew.egretel.service.BandejaEspecialistaServiceImpl;

/**
 *
 * @author ltantaruna
 */
public class BandejaEspecialistaServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        // aqui deberia obtener el numero de reclamo
        String vIdReclamo = request.getParameter("idreclamo");

        // Llamar al model
        BandejaEspecialistaService vBandejaService = new BandejaEspecialistaServiceImpl();

        Reclamo vReclamo = vBandejaService.ObtenerReclamo(vIdReclamo);

        // Setear el model para el view
        request.setAttribute("reclamo", vReclamo);

        request.getRequestDispatcher("DetalleReclamo_Especialista.jsp").forward(request, response);
        // request.getRequestDispatcher("DetalleTicket_Tecnico.jsp").forward(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    }

    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>

    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        try {
        } finally {
            out.close();
        }
    }
}
